﻿<%@ Import Namespace="System.Web.Core" %>
<%@ Import Namespace="Yuanlin.Business" %>
<%@ Control Language="C#" Inherits="Yuanlin.Business.CompanyFisherys, Yuanlin.Business" AutoEventWireup="true" %>

<script type="text/javascript">
function showInfo()  
{  
    var info = document.getElementById("info");
    var scrolltop = window.pageYOffset  || document.documentElement.scrollTop  || document.body.scrollTop || 0;
    var leftedge    = document.body.clientWidth-event.clientX;
    var bottomedge  = document.body.clientHeight-event.clientY;
    /*如果从鼠标位置到窗口右边的空间小于DIV的宽度，就定位DIV的左坐标（Left）为当前鼠标位置向左一个DIV宽度*/
    if (leftedge < info.offsetWidth)
    {
        info.style.left = document.body.scrollLeft + event.clientX - info.offsetWidth;
    }
    else
    {
        /*否则，就定位DIV的左坐标为当前鼠标位置*/
        info.style.left = document.body.scrollLeft + event.clientX;
    }
    /*如果从鼠标位置到窗口下边的空间小于DIV的高度，就定位DIV的上坐标（Top）为当前鼠标位置向上一个DIV高度*/
    if (bottomedge < info.offsetHeight)
    {
        info.style.top = scrolltop + event.clientY - info.offsetHeight;
    }
    else
    {
        /*否则，就定位DIV的上坐标为当前鼠标位置*/
        info.style.top = scrolltop + event.clientY;
    }
    info.style.display = "block"; 
}  
function hiddenInfo()  
{  
    document.getElementById("info").style.display = "none";  
}  
function Fpop(obj)
{    
    var popDiv = document.getElementById('popDiv');
    popDiv.innerHTML ="<img src=\""+obj.img+"\" width='200px' height='200px' />";

    var scrolltop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
    var leftedge    = document.body.clientWidth-event.clientX;
    var bottomedge  = document.body.clientHeight-event.clientY;
    if (leftedge < popDiv.offsetWidth)
    {
        popDiv.style.left = document.body.scrollLeft + event.clientX - popDiv.offsetWidth;
    }
    else
    {
        popDiv.style.left = document.body.scrollLeft + event.clientX;
    }
    if (bottomedge < popDiv.offsetHeight)
    {
        popDiv.style.top = scrolltop + event.clientY - popDiv.offsetHeight;
    }
    else
    {
        popDiv.style.top = scrolltop + event.clientY;
    }

    popDiv.style.display="";
}
function Fhidden()
{
    document.getElementById('popDiv').style.display="none";
}

</script>
<table class="company_nav" cellspacing="0" cellpadding="0" width="98%" border="0"
    align="center">
    <tbody>
        <tr>
            <td class="now" width="116">
                以目录方式浏览
            </td>
            <td class="now_bb" width="7">
                &nbsp;
            </td>
            <td class="mid" width="116">
                <a href="<%= SiteUrls.Instance().GetCompanyFisheryUrl(tradeType,categoryId,appCategoryId,1,categoryType) %>">
                    以橱窗方式浏览</a>
            </td>
            <td class="now_bb">
                &nbsp;
            </td>
        </tr>
    </tbody>
</table>
<table class="p14h24" id="com_info_com" cellspacing="0" cellpadding="10" width="98%"
    align="center" border="0">
    <tbody>
        <tr>
            <td class="note" style="word-break: break-all" align="center">
                <table class="tabls" id="tabls" cellspacing="0" cellpadding="0" width="100%" border="0">
                    <tbody>
                        <tr class="tabls_head">
                            <td align="middle" width="100">
                                图片
                            </td>
                            <td align="middle" width="120">
                                常用名
                            </td>
                            <td align="middle" width="110">
                                品种
                            </td>
                             <td align="middle" width="110">
                                规格
                            </td>
                             <td align="middle" width="110">
                                单位
                            </td>
                            <td align="middle" width="110">
                                数量
                            </td>
                            <td align="middle" width="110">
                                价格(元)
                            </td>
                            <td align="middle" width="100">
                                发布日期
                            </td>
                            <td align="middle" width="100">
                                商标
                            </td>
                            <td align="middle" width="110">
                                字典
                            </td>
                        </tr>
                        <asp:Repeater EnableViewState="false" runat="server" ID="list">
                            <ItemTemplate>
                                <tr>
                                    <td align="middle">
                                        <table height="40" cellspacing="0" cellpadding="0" width="100" border="0">
                                            <tbody>
                                                <tr>
                                                    <td align="middle">
                                                        <a href="<%# SiteUrls.Instance().GetUserFisheryUrl(((CompanyFishery) Container.DataItem).GreenNum.Value, ((CompanyFishery) Container.DataItem).EntityId.Value, ((CompanyFishery) Container.DataItem).TradeType.Value) %>"
                                                            target="_self" onmouseout="Fhidden()" onmouseover="Fpop(this)" img="<%#SiteUrls.Instance().GetAttachmentFullVirtualPathUrl((CompanyFishery)Container.DataItem)%>">
                                                            <nwap:YuanlinImage runat="server" UseRealSize="false" ImageType="Details"  ID="productImg"
                                                                Width="38" Height="38" DefaultFileName="defaultSiteSmallPic.gif" Attachment="<%# (CompanyFishery) Container.DataItem%>"/>
                                                        </a>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                        <div id="popDiv" style="position:absolute;z-index:10;border:1px solid black;display:none;"></div>
                                    </td>
                                    <td class="td_con_1" align="left">
                                        <a target="_self" href="<%# SiteUrls.Instance().GetUserFisheryUrl(((CompanyFishery) Container.DataItem).GreenNum.Value, ((CompanyFishery) Container.DataItem).EntityId.Value, ((CompanyFishery) Container.DataItem).TradeType.Value) %>" title="<%# ((CompanyFishery)Container.DataItem).Title.Value%>">
                                            <%# ((CompanyFishery)Container.DataItem).Title.Value%>
                                        </a>
                                    </td>
                                    <td align="middle">
                                        <%# ((CompanyFishery)Container.DataItem).PinNameTitle.Value%>
                                    </td>
                                     <td align="middle" title="<%# GetAquacultureGuiGe(((CompanyFishery)Container.DataItem).CategoryId.Value, 0)%>">
                                        <%# GetAquacultureGuiGe(((CompanyFishery)Container.DataItem).CategoryId.Value, 0)%>
                                    </td>
                                     <td align="middle" title="<%# GetAquacultureGuiGe(((CompanyFishery)Container.DataItem).CategoryId.Value, 1)%>">
                                        <%# GetAquacultureGuiGe(((CompanyFishery)Container.DataItem).CategoryId.Value, 1)%>
                                    </td>
                                    <td align="middle">
                                        <%# ((CompanyFishery)Container.DataItem).Number.Value%>
                                    </td>
                                    <td align="middle">
                                        <%# ((CompanyFishery)Container.DataItem).ProductPriceFromFace.Value == 1 ? "面议" : ((CompanyFishery)Container.DataItem).Price.Value.ToString("f2")%>
                                    </td>
                                    <td align="middle">
                                        <%# ((CompanyFishery)Container.DataItem).CreateDate.Value.ToShortDateString()%>
                                    </td>
                                    <td align="middle">
                                        <%# ((CompanyFishery)Container.DataItem).RegisterTrademark.Value%>
                                    </td>
                                    <td align="middle">
                                        <a target="<%# GetTarget(((CompanyFishery) Container.DataItem).FisheryId.Value) %>" href="<%# GetDicUrl(((CompanyFishery) Container.DataItem).FisheryId.Value) %>">
                                            <img src="<%= System.Web.Core.Globals.ApplicationPath %>/themes/default/images/small_ebook.gif" class="pointer" onmouseover="showInfo()" onmouseout="hiddenInfo()" style="border:0px"/>
                                        </a>
                                        <div id="info" style="display:none;position:absolute;background-color:#EFEFEF;width:200px"><%# ((CompanyFishery)Container.DataItem).Body.Value%></div>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </tbody>
                </table>
                <div class="PagingWrapper">
                    <asp:Panel ID="Panel1" runat="server" align="right" CssClass="CommonPagingArea">
                        <nwap:CurrentPage CssClass="columnText" ID="currentPage" runat="server" />
                        <nwap:YuanlinPager Pager="CompanyFishery2" ID="pager" runat="server" PageSize="14" />
                    </asp:Panel>
                </div>
            </td>
        </tr>
    </tbody>
</table>

